package cn.gson.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the EMP_CHARACTER database table.
 * 
 */
@Entity
@Table(name="EMP_CHARACTER")
@NamedQuery(name="EmpCharacter.findAll", query="SELECT e FROM EmpCharacter e")
public class EmpCharacter implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="C_ID")
	private long cId;

	@Column(name="C_DESCRIBE")
	private String cDescribe;

	@Column(name="C_NAME")
	private String cName;

	//bi-directional many-to-one association to EmpAndCharacter
	@OneToMany(mappedBy="empCharacter")
	private List<EmpAndCharacter> empAndCharacters;

	//bi-directional many-to-many association to CharacterFunction
	@ManyToMany
	@JoinTable(
		name="FK_CHA_FUNCTION"
		, joinColumns={
			@JoinColumn(name="C_ID")
			}
		, inverseJoinColumns={
			@JoinColumn(name="F_ID")
			}
		)
	private List<CharacterFunction> characterFunctions;

	public EmpCharacter() {
	}

	public long getCId() {
		return this.cId;
	}

	public void setCId(long cId) {
		this.cId = cId;
	}

	public String getCDescribe() {
		return this.cDescribe;
	}

	public void setCDescribe(String cDescribe) {
		this.cDescribe = cDescribe;
	}

	public String getCName() {
		return this.cName;
	}

	public void setCName(String cName) {
		this.cName = cName;
	}

	public List<EmpAndCharacter> getEmpAndCharacters() {
		return this.empAndCharacters;
	}

	public void setEmpAndCharacters(List<EmpAndCharacter> empAndCharacters) {
		this.empAndCharacters = empAndCharacters;
	}

	public EmpAndCharacter addEmpAndCharacter(EmpAndCharacter empAndCharacter) {
		getEmpAndCharacters().add(empAndCharacter);
		empAndCharacter.setEmpCharacter(this);

		return empAndCharacter;
	}

	public EmpAndCharacter removeEmpAndCharacter(EmpAndCharacter empAndCharacter) {
		getEmpAndCharacters().remove(empAndCharacter);
		empAndCharacter.setEmpCharacter(null);

		return empAndCharacter;
	}

	public List<CharacterFunction> getCharacterFunctions() {
		return this.characterFunctions;
	}

	public void setCharacterFunctions(List<CharacterFunction> characterFunctions) {
		this.characterFunctions = characterFunctions;
	}

}